import 'dart:ui';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';

class DeviceUtils {
  //**获取屏幕宽度
  static double screenWidth(BuildContext context) {
    return MediaQuery.of(context).size.width;
  }

  //**获取屏幕高度
  static double screenHeight(BuildContext context) {
    return MediaQuery.of(context).size.height;
  }

  //**获取屏幕高度
  static double statusBarHeight(BuildContext context) {
    return MediaQueryData.fromWindow(window).padding.top;
  }

  static void statusBarFont(Brightness brightness){
    SystemUiOverlayStyle systemUiOverlayStyle = SystemUiOverlayStyle(
      statusBarColor: Colors.transparent,
      statusBarBrightness: brightness,
      statusBarIconBrightness: brightness,
    );
    SystemChrome.setSystemUIOverlayStyle(systemUiOverlayStyle);
  }

}
